package cn.chengpengper.shortlink.service;

import cn.chengpengper.shortlink.enums.SendCodeEnum;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author huchengpeng
 * @version v1.0.0
 * @date 2023/8/21 00:19
 * @description 验证码服务
 */
public interface CaptchaService {
    /**
     * 获取图形验证码
     *
     * @param request  HttpServletRequest
     * @param response HttpServletResponse
     */
    void getImageCaptcha(HttpServletRequest request, HttpServletResponse response);

    /**
     * 验证码校验
     *
     * @param type 验证码使用场景
     * @param to   发送方
     * @param code 验证码
     * @return boolean
     */
    boolean captchaVerify(SendCodeEnum type, String to, String code);
}
